﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="System.Web.Mvc.ViewPage<System.Collections.Generic.List<BlogEngine.Core.Category>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
    <h2>分类管理</h2>
    <table>
        <thead>
            <tr><td>标题</td><td>操作</td></tr>
        </thead>
        <tbody>
            <% if(null != ViewData.Model && ViewData.Model.Count > 0){  
                foreach(Category category in ViewData.Model){ %>
                <tr>
                    <td><%= category.Title%></td>
                    <td>
                        <%= Html.ActionLink("编辑", "EditCategory", new { id = category.Id })%>&nbsp;
                        <%= Html.ActionLink("删除", "DelCategory", new { id = category.Id }, new { onclick = "return confirm('你确定要删除该随笔?')" })%>
                    </td> 
                </tr>
            <% } } %>
        </tbody>
    </table>
    <br /><br />
    <h2>添加分类</h2>
    
    <% Html.RenderPartial("_CategoryForm"); %>
    
    <script type="text/javascript" language="javascript">
        SetCurrentTag("categorysManage");
        //SetCurrentTag("");
    </script>
</asp:Content>
